// 封装axios

import axios from "axios";
import { getBaseUrl } from "../env/apiconfig";

const requestInstance = axios.create({
    baseURL: getBaseUrl(),
    timeout: 5000
})

requestInstance.interceptors.request.use(
  (config) => {
    return config
  },
  (error) => {
    return Promise.reject(error)
  }
)

requestInstance.interceptors.response.use(
  (response) => {
    return response
  },
  (error) => {
    return Promise.reject(error)
  }
)

export default requestInstance